/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Com.agenceLocation.bdd;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author gantz
 */
public class Entity {
    private static EntityManager Instance;
    
    public static EntityManager GetInstance()
    {
        if(Instance != null)
            return Instance;
        else
        {
            EntityManagerFactory factory = Persistence.createEntityManagerFactory("AgenceVertePU");
            Instance = factory.createEntityManager();
            return Instance;
        }
    }
}
